package com.yang.springboot.web;

import com.yang.springboot.model.Student;
import com.yang.springboot.service.IStudentService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author yanwei.yang
 * @date 2021/11/16 16:18
 * @description:
 */


@RestController
public class StudentController {


    @Resource
    private IStudentService studentService;

    @GetMapping("student")
    public Object student(Integer id, Integer age) {
        Student student = new Student();
        student.setId(id);
        student.setAge(age);
        return student;
    }


    @GetMapping("/student/detail/{id}/{age}")
    public Object studentDetail(@PathVariable("id") Integer id,
                                @PathVariable("age") Integer age) {
        Student student = new Student();
        student.setId(id);
        student.setAge(age);
        return student;
    }


}
